package com.yanqu.road.server.cmd.activity.yqhotel;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.YqHotelProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.yqhotel.YqHotelModule;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;


@Cmd(code = GameProtocol.S_YQ_HOTEL_BEAT_BOSS, desc = "阳泉酒家打boss")
public class YqHotelBeatBossCmd extends AbstractCommand {

    private int type;
    private int solderId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        YqHotelProto.YqHotelSolderTestReqMsg reqMsg = YqHotelProto.YqHotelSolderTestReqMsg.parseFrom(packet.getBytes());
        type = reqMsg.getType();
        solderId = reqMsg.getSolderId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        YqHotelProto.YqHotelSolderTestRespMsg.Builder respMsg = player.getModule(YqHotelModule.class).bossTest(type,solderId);
        player.sendPacket(ClientProtocol.U_YQ_HOTEL_BEAT_BOSS, respMsg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
    
    
    
    
}
